package licode.unisop.single.platform.application.gateway;

import licode.unisop.provider.info.AssetHoldPageInfo;
import licode.unisop.provider.info.HoldAssetPageInfo;
import licode.unisop.provider.info.SiRemoveAllRelAsset;
import licode.unisop.provider.vo.SiAssetRelEntity;
import licode.unisop.provider.vo.SiPageResult;
import licode.unisop.single.platform.application.info.*;

import java.io.Serializable;
import java.util.List;

/**
 * uni-platform-single
 *
 * @author licode
 * @date 2016-08-27 15:30:59
 */
public interface PlatAssetRelDao {
    void add(SiAssetRelEntity item);
    void addBatch(List<SiAssetRelEntity> items);
    void update(SiAssetRelEntity item);
    void updateBatch(List<SiAssetRelEntity> items);
    void removeWithId(Serializable id);
    SiAssetRelEntity getWithId(Serializable id);

    void removeAssets(RemoveHoldAssetsIn info);
    void removeHolders(RemoveAssetHoldsIn info);

    void removeAll(SiAssetRemove idRem);
    void removeAllRelAsset(SiRemoveAllRelAsset req);

    /**
     * 找到资源关联的其它资源集合
     * @param info 资源信息
     * @return 包含指定资源的其它资源集合
     */
    List<SiAssetRelEntity> getRelations(RelationIdInfo info);

    SiPageResult<SiAssetRelEntity> getRelationsPage(RelationIdPage info);

    SiPageResult<SiAssetRelEntity> findHoldRefAssetPage(HoldAssetPageInfo req);
    SiPageResult<SiAssetRelEntity> findAssetRefHoldPage(AssetHoldPageInfo req);

    SiPageResult<SiAssetRelEntity> findHoldAssetPage(HoldAssetPageInfo req);
    SiPageResult<SiAssetRelEntity> findAssetHoldPage(AssetHoldPageInfo req);
}
